package com.example.demo.pojo;


import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@Getter
public class Response<T> {

    private int code;

    private String message;

    private User user;

    private Product product;

    private Order order;

    private ProductStar productStar;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<T> list;

    public Response() {
    }

    public Response(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Response(int code, String message, User user) {
        this.code = code;
        this.message = message;
        this.user = user;
    }

    public Response(int code, String message, Product product) {
        this.code = code;
        this.message = message;
        this.product = product;
    }

    public Response(int code, String message, ProductStar productStar) {
        this.code = code;
        this.message = message;
        this.productStar = productStar;
    }

    public Response(int code, String message, List<T> list) {
        this.code = code;
        this.message = message;
        this.list = list;
    }

    public Response(int code, String message, User user, Product product, Order order, List<T> list) {
        this.code = code;
        this.message = message;
        this.user = user;
        this.product = product;
        this.order = order;
        this.list = list;
    }


    @Override
    public String toString() {
        return "Response{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", user=" + user +
                ", product=" + product +
                ", order=" + order +
                ", productStar=" + productStar +
                ", list=" + list +
                '}';
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public User getUser() {
        return user;
    }

    public Product getProduct() {
        return product;
    }


    public Order getOrder() {
        return order;
    }

    public List<T> getList() {
        return list;
    }

    public ProductStar getProductStar() {
        return productStar;
    }

    public void setProductStar(ProductStar productStar) {
        this.productStar = productStar;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public void setProduct(Product product) {
        this.product = product;
    }


    public void setCode(int code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
